package week2;
import week2.ArrayStack;

import java.util.Scanner;
import java.util.StringTokenizer;
public class reverse {
    public static void main(String[] args) {
        String number="",result="";
        Scanner scan=new Scanner(System.in);
        System.out.println("请输入");
        ArrayStack stack=new ArrayStack();
        number=scan.nextLine();
        StringTokenizer Tokenizer= new StringTokenizer(number);
         while(Tokenizer.hasMoreTokens()){
            stack.push(Tokenizer.nextToken());
        }
        while(!stack.isEmpty())
        {
            result+=stack.pop()+" ";
        }
        System.out.println(result);
    }

}
